package com.hospital.managing.information.system.controller;

import com.alibaba.fastjson.JSON;
import com.hospital.managing.information.system.model.Department;
import com.hospital.managing.information.system.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class DepartmentController {
    @Autowired
    private IDepartmentService iDepartmentService;
    @PostMapping("/getDepartment")
    @ResponseBody
    public String getDepartment(Department department, ModelMap modelMap){
        List<Department> list=iDepartmentService.selectDepartment();
        return JSON.toJSONString(list);
    }
}
